package cn.iocoder.yudao.module.reading.enums.recording;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 配音状态枚举
 *
 * @author 芋道源码
 */
@AllArgsConstructor
@Getter
public enum RecordingStatusEnum {

    DRAFT("draft", "草稿"),
    PUBLISHED("published", "已发布"),
    DELETED("deleted", "已删除");

    /**
     * 状态代码
     */
    private final String code;
    /**
     * 状态名称
     */
    private final String name;

    public static RecordingStatusEnum fromCode(String code) {
        for (RecordingStatusEnum status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }

}
